// CodeGear C++Builder
// Copyright (c) 1995, 2015 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ocv.comp.FFMSource.pas' rev: 30.00 (Windows)

#ifndef Ocv_Comp_FfmsourceHPP
#define Ocv_Comp_FfmsourceHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <System.SyncObjs.hpp>
#include <ocv.comp.Source.hpp>
#include <libavcodec.hpp>
#include <ocv.comp.Types.hpp>

//-- user supplied -----------------------------------------------------------

namespace Ocv
{
namespace Comp
{
namespace Ffmsource
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TocvFFMpegIPCamSource;
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TOnNotifyFFMpegPacket)(System::TObject* Sender, const Libavcodec::AVPacket &packet, const bool isKeyFrame);

enum DECLSPEC_DENUM TocvFFMpegIPCamEvent : unsigned char { ffocvTryConnect, ffocvConnected, ffocvLostConnection, ffocvReconnect, ffocvErrorGetStream };

typedef void __fastcall (__closure *TOnocvFFMpegIPCamEvent)(System::TObject* Sender, const TocvFFMpegIPCamEvent Event);

class PASCALIMPLEMENTATION TocvFFMpegIPCamSource : public Ocv::Comp::Source::TocvCustomSource
{
	typedef Ocv::Comp::Source::TocvCustomSource inherited;
	
private:
	System::Word FPort;
	System::UnicodeString FPassword;
	System::UnicodeString FIP;
	System::UnicodeString FUserName;
	System::UnicodeString FURI;
	TOnNotifyFFMpegPacket FOnNotifyFFMpegPacket;
	Ocv::Comp::Source::TocvIPProtocol FProtocol;
	unsigned FReconnectDelay;
	TOnocvFFMpegIPCamEvent FOnIPCamEvent;
	void __fastcall SetReconnectDelay(const unsigned Value);
	
protected:
	virtual void __fastcall TerminateSourceThread(void);
	System::AnsiString __fastcall GetIPCamTarget(void);
	virtual void __fastcall SetEnabled(bool Value);
	virtual void __fastcall Loaded(void);
	void __fastcall DoNotifyPacket(const Libavcodec::AVPacket &packet, const bool isKeyFrame);
	void __fastcall DoNotifyEvent(TocvFFMpegIPCamEvent Event);
	
public:
	__fastcall virtual TocvFFMpegIPCamSource(System::Classes::TComponent* AOwner);
	
__published:
	__property System::UnicodeString UserName = {read=FUserName, write=FUserName};
	__property System::UnicodeString Password = {read=FPassword, write=FPassword};
	__property System::UnicodeString IP = {read=FIP, write=FIP};
	__property System::UnicodeString URI = {read=FURI, write=FURI};
	__property System::Word Port = {read=FPort, write=FPort, default=554};
	__property Ocv::Comp::Source::TocvIPProtocol Protocol = {read=FProtocol, write=FProtocol, default=2};
	__property TOnNotifyFFMpegPacket OnFFMpegPacket = {read=FOnNotifyFFMpegPacket, write=FOnNotifyFFMpegPacket};
	__property TOnocvFFMpegIPCamEvent OnIPCamEvent = {read=FOnIPCamEvent, write=FOnIPCamEvent};
	__property unsigned ReconnectDelay = {read=FReconnectDelay, write=SetReconnectDelay, default=1000};
public:
	/* TocvCustomSource.Destroy */ inline __fastcall virtual ~TocvFFMpegIPCamSource(void) { }
	
};


//-- var, const, procedure ---------------------------------------------------
}	/* namespace Ffmsource */
}	/* namespace Comp */
}	/* namespace Ocv */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_OCV_COMP_FFMSOURCE)
using namespace Ocv::Comp::Ffmsource;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_OCV_COMP)
using namespace Ocv::Comp;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_OCV)
using namespace Ocv;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Ocv_Comp_FfmsourceHPP
